#ifndef __COM_CONFIG_H__
#define __COM_CONFIG_H__

#include "tim.h"
#include "gpio.h"
#define HEAD_CHECK0 'X'
#define HEAD_CHECK1 'U'
#define HEAD_CHECK2 'L'
typedef enum
{
    COM_OK,
    COM_ERROR
}Com_State;

typedef struct
{
    TIM_HandleTypeDef *htim;
    uint32_t channel;
    int16_t speed;

} Motor_struct;
//定义灯
typedef struct
{
    GPIO_TypeDef *port;
    uint32_t pin;

}LED_struct;
//定义遥控状态
typedef enum
{
  CONNECT,
  DISCONNECT
}Control_status;
//定义飞行状态
typedef enum
{
  IDLE,
  NORMAL,
  FIX_HEIGHT,
  FAULT
}Fly_status;
// 定义遥控器
typedef struct
{
  int16_t THR;
  int16_t YAW;
  int16_t PITCH;
  int16_t ROLL;
  uint8_t SHUT_DOWN;
  uint8_t MPU6050_RESET;
  uint8_t FIX_HEIGHT;
} Remote_struct;
//定义油门的状态
typedef enum
{
    FREE,
    MAX,
    MIN,
    LEAVE_MAX,
    UNLOCK
}Throttle_State;

typedef struct
{
    int16_t x;
    int16_t y;
    int16_t z;
} Gyro_Struct;


typedef struct
{
    int16_t x;
    int16_t y;
    int16_t z;
} Accel_Struct;


typedef struct
{
    Gyro_Struct gyro;
    Accel_Struct accel;
} GyroAccel_Struct;
typedef struct
{
    float yaw;
    float pitch;
    float roll;
}EulerAngle_Struct;
#endif /* __COM_CONFIG_H__ */
